package practice07;

public class Teacher extends  Person{
    private Klass klass;

    public Klass getKlass(){
        return klass;
    }
    public Teacher(String name, Integer age) {
        super(name, age);
    }
    public Teacher(String name,Integer age,Klass klass){
        super(name,age);
        this.klass=klass;
    }
    @Override
    public String introduce(){
        if(getKlass()==null){
            return super.introduce()+" I am a Teacher. I teach No Class.";
        }
        return super.introduce()+" I am a Teacher. I teach Class "+klass.getNumber()+".";
    }
    public String introduceWith(Student student){
        if(getKlass()==student.getKlass()){
            return super.introduce()+" I am a Teacher. I teach "+student.getName()+".";
        }
        return  super.introduce()+" I am a Teacher. I don't teach "+student.getName()+".";
    }
}
